package com.yowasa.xiuxian.engine.travel.adventure;

import com.google.common.collect.Sets;
import com.yowasa.xiuxian.engine.travel.AdventureInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.MapEnum;
import com.yowasa.xiuxian.service.helper.UserHelper;
import com.yowasa.xiuxian.util.RandomUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Set;

@Component
public class PoTianFuGui implements AdventureInterface {

    @Autowired
    private UserHelper userHelper;

    @Override
    public Set<MapEnum> limitMaps() {
        return Sets.newHashSet(MapEnum.JUE_YUN_JIAN,MapEnum.PU_GONG_YING_HAI);
    }


    @Override
    public String exec(UserBO user) {
        int num = RandomUtil.randomInt(150, 350) * user.getUserAttr().getLuc() / 25;
        user.getUserConfig().setGold(user.getUserConfig().getGold() + num);

        userHelper.lockUser(user,30,user.getName()+"正在秘境探索中");
        return "你找到了一张藏宝图，你一番探索，将收获出售后，收获了"+num+"点摩拉";
    }


    public boolean isConflict() {
        return true;
    }

    public int weight() {
        return 4;
    }

}